/**
 * 
 */
package com.chinasofti.project.service.user.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chinasofti.project.dal.mapper.custom.BzShippingAddressMapperCustom;
import com.chinasofti.project.dal.model.BzShippingAddress;
import com.chinasofti.project.dal.model.BzShippingAddressExample;
import com.chinasofti.project.service.user.ShippingAddressService;

/**
 * @author liuji
 *
 */
@Service("shippingAddressService")
public class ShippingAddressServiceImpl implements ShippingAddressService {
	@Autowired
	public BzShippingAddressMapperCustom BzShippingAddressMapper;

	@Override
	public boolean addShippingAddress(BzShippingAddress bzShippingAddress) {
		Date date = new Date();
		bzShippingAddress.setSaTime(date);
		BzShippingAddressMapper.insertSelective(bzShippingAddress);
		return true;
	}

	@Override
	public List<BzShippingAddress> ShippingAddressResult(BzShippingAddress bzShippingAddress) {
		BzShippingAddressExample b = new BzShippingAddressExample();
		b.createCriteria().andUserIdEqualTo(bzShippingAddress.getUserId());
		return BzShippingAddressMapper.selectByExample(b);
	}

}
